package com.lxj.fast_android_demo.ui;

import java.util.HashMap;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.lxj.fast_android_demo.R;

public class FormAc extends Activity {
	private Button btnReturn;
	private TextView tvFormTitle;
	private TextView tvTitle1;
	private TextView tvTitle2;
	private TextView tvTitle3;
	private TextView tvTitle4;
	private TextView tvTitle5;
	private TextView tvTitle6;
	private TextView tvTitle7;
	private TextView tvItem1;
	private TextView tvItem2;
	private TextView tvItem3;
	private TextView tvItem4;
	private TextView tvItem5;
	private TextView tvItem6;
	private TextView tvItem7;
	private static HashMap<String, Object> dataMap;

	public static void lunch(Activity ac, HashMap<String, Object> dataMap) {
		FormAc.dataMap = dataMap;
		ac.startActivity(new Intent(ac, FormAc.class));
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.form_ac);
		btnReturn = (Button) findViewById(R.id.btnReturn);
		btnReturn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				finish();
			}
		});

		tvFormTitle = (TextView) findViewById(R.id.tvFormTitle);
		tvTitle1 = (TextView) findViewById(R.id.tvTitle1);
		tvTitle2 = (TextView) findViewById(R.id.tvTitle2);
		tvTitle3 = (TextView) findViewById(R.id.tvTitle3);
		tvTitle4 = (TextView) findViewById(R.id.tvTitle4);
		tvTitle5 = (TextView) findViewById(R.id.tvTitle5);
		tvTitle6 = (TextView) findViewById(R.id.tvTitle6);
		tvTitle7 = (TextView) findViewById(R.id.tvTitle7);
		tvItem1 = (TextView) findViewById(R.id.tvItem1);
		tvItem2 = (TextView) findViewById(R.id.tvItem2);
		tvItem3 = (TextView) findViewById(R.id.tvItem3);
		tvItem4 = (TextView) findViewById(R.id.tvItem4);
		tvItem5 = (TextView) findViewById(R.id.tvItem5);
		tvItem6 = (TextView) findViewById(R.id.tvItem6);
		tvItem7 = (TextView) findViewById(R.id.tvItem7);

		tvFormTitle.setText(String.valueOf(dataMap.get("empName")));
		tvTitle1.setText("姓名");
		tvTitle2.setText("年龄");
		tvTitle3.setText("性别");
		tvTitle4.setText("备注");
		tvTitle5.setText("factor1");
		tvTitle6.setText("factor2");
		tvTitle7.setText("result");
		tvItem1.setText(String.valueOf(dataMap.get("empName")));
		tvItem2.setText(String.valueOf(dataMap.get("empAge")));
		tvItem3.setText(String.valueOf(dataMap.get("empGender")));
		tvItem4.setText(String.valueOf(dataMap.get("memo")));
		tvItem5.setText(String.valueOf(dataMap.get("factor1")));
		tvItem6.setText(String.valueOf(dataMap.get("factor2")));
		tvItem7.setText(String.valueOf(dataMap.get("result")));
	}
}
